const request = uni.$u.http

// 获取频道数据
export const getChannels = () => {
  console.log('获取成功')
  return {
    code: 0,
    message: 'ok',
    data: [
      {
        id: 1,
        name: '前端'
      },
      {
        id: 2,
        name: '后端'
      },
      {
        id: 3,
        name: 'web前端'
      },
      {
        id: 4,
        name: 'ios'
      },
      {
        id: 5,
        name: '大数据'
      },
      {
        id: 6,
        name: '区块链'
      },
      {
        id: 7,
        name: '架构'
      },
      {
        id: 8,
        name: 'java'
      },
      {
        id: 9,
        name: 'php'
      },
      {
        id: 10,
        name: 'html'
      },
      {
        id: 11,
        name: 'css'
      }
    ]
  }
}

// 获取文章列表
export const getArticles = (params) => {
  const data = []
  for (let i = 0; i < 10; i++) {
    const res = {
      id: i,
      art_id: 12436675543234,
      aut_id: 1,
      aut_name: '你的Maya',
      ch_id: 1,
      collect_count: 1,
      comm_count: 1,
      cover: { type: 0, images: [] },
      is_top: 0,
      like_count: 0,
      pubdate: '2022-10-31T09:25:31',
      pre_timestamp: Date.now(),
      title: '今天很不错吃啊的负担' + i
    }
    data.push(res)
  }
  return data
}

export const getUserChannels = () => {
  return {
    code: 0,
    message: 'ok',
    data: [
      {
        id: 1,
        name: '前端'
      },
      {
        id: 2,
        name: '后端'
      },
      {
        id: 3,
        name: 'web前端'
      },
      {
        id: 4,
        name: 'ios'
      }
    ]
  }
}

// export const getChannels = (data) => {
//   console.log(data)
//   return data
// }
